import request from '@/utils/request'

// 查询物资类别列表
export function listCategory(query) {
  return request({
    url: '/aid/category/list',
    method: 'get',
    params: query
  })
}

// 查询所有物资类别（树形结构）
export function listAllCategory() {
  return request({
    url: '/aid/category/all',
    method: 'get'
  })
}

// 查询物资类别详细
export function getCategory(categoryId) {
  return request({
    url: '/aid/category/' + categoryId,
    method: 'get'
  })
}

// 查询物资类别树结构
export function listAidCategoryTree() {
  return request({
    url: '/aid/category/tree',
    method: 'get'
  })
}

// 新增物资类别
export function addCategory(data) {
  return request({
    url: '/aid/category',
    method: 'post',
    data: data
  })
}

// 修改物资类别
export function updateCategory(data) {
  return request({
    url: '/aid/category',
    method: 'put',
    data: data
  })
}

// 删除物资类别
export function delCategory(categoryId) {
  return request({
    url: '/aid/category/' + categoryId,
    method: 'delete'
  })
} 